import { ScrollView, View } from "@tarojs/components";
import ChatTalkItem from "../ChatTalkItem";
import "./index.scss";

const ChatTalk = ({ talkLists, selectTalk, onHandleChangeTalk }) => {
  return (
    <View className="chat_talk">
      <View className="chat_talk_header">
        {`历史对话（${talkLists?.length || 0}）`}
      </View>
      <ScrollView scrollY className="chat_talk_list">
        {talkLists?.map((item) => {
          return (
            <ChatTalkItem
              talkItem={item}
              selectTalk={selectTalk}
              onHandleChangeTalk={onHandleChangeTalk}
            />
          );
        })}
      </ScrollView>
    </View>
  );
};

export default ChatTalk;
